home *** CD-ROM | disk | FTP | other *** search
MacBinary | 1989-04-01 | 11.8 KB | [TEXT/MPS ] |
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: MacBinary
(archive/macBinary).
Confidence | Program | Detection | Match Type | Support
|
---|
10%
| dexvert
| MacBinary (archive/macBinary)
| fallback
| Supported |
1%
| dexvert
| MS-DOS Code Page Info (other/dosCodePage)
| ext
| Unsupported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| MacBinary II, Sat Apr 1 15:02:04 1989, modified Sat Apr 1 15:02:04 1989, creator 'MPS ', type ASCII, 11455 bytes "TESample.cp" , at 0x2d3f 382 bytes resource
| default (weak)
| |
99%
| file
| data
| default
| |
74%
| TrID
| Macintosh plain text (MacBinary)
| default
| |
25%
| TrID
| MacBinary 2
| default (weak)
| |
100%
| siegfried
| fmt/1762 MacBinary (II)
| default
| |
100%
| lsar
| MacBinary
| default
|
|
id metadata |
---|
key | value |
---|
macFileType | [TEXT] |
macFileCreator | [MPS ] |
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0b 54 45 53 61 6d 70 | 6c 65 2e 63 70 00 00 00 |..TESamp|le.cp...|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 50 53 | 20 00 00 00 00 00 00 00 |.TEXTMPS| .......|
|00000050| 00 00 00 00 00 2c bf 00 | 00 01 7e a0 5a db 3c a0 |.....,..|..~.Z.<.|
|00000060| 5a db 3c 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |Z.<.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 43 6a 00 00 |........|....Cj..|
|00000080| 2f 2a 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |/*------|--------|
|00000090| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000000a0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000000b0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000000c0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000000d0| 0d 23 0d 23 09 41 70 70 | 6c 65 20 4d 61 63 69 6e |.#.#.App|le Macin|
|000000e0| 74 6f 73 68 20 44 65 76 | 65 6c 6f 70 65 72 20 54 |tosh Dev|eloper T|
|000000f0| 65 63 68 6e 69 63 61 6c | 20 53 75 70 70 6f 72 74 |echnical| Support|
|00000100| 0d 23 0d 23 09 4d 75 6c | 74 69 46 69 6e 64 65 72 |.#.#.Mul|tiFinder|
|00000110| 2d 41 77 61 72 65 20 53 | 69 6d 70 6c 65 20 54 65 |-Aware S|imple Te|
|00000120| 78 74 45 64 69 74 20 53 | 61 6d 70 6c 65 20 41 70 |xtEdit S|ample Ap|
|00000130| 70 6c 69 63 61 74 69 6f | 6e 0d 23 0d 23 09 43 50 |plicatio|n.#.#.CP|
|00000140| 6c 75 73 54 45 53 61 6d | 70 6c 65 0d 23 0d 23 09 |lusTESam|ple.#.#.|
|00000150| 54 45 53 61 6d 70 6c 65 | 2e 63 70 09 2d 09 43 2b |TESample|.cp.-.C+|
|00000160| 2b 20 73 6f 75 72 63 65 | 0d 23 0d 23 09 43 6f 70 |+ source|.#.#.Cop|
|00000170| 79 72 69 67 68 74 20 a9 | 20 31 39 38 39 20 41 70 |yright .| 1989 Ap|
|00000180| 70 6c 65 20 43 6f 6d 70 | 75 74 65 72 2c 20 49 6e |ple Comp|uter, In|
|00000190| 63 2e 0d 23 09 41 6c 6c | 20 72 69 67 68 74 73 20 |c..#.All| rights |
|000001a0| 72 65 73 65 72 76 65 64 | 2e 0d 23 0d 23 09 56 65 |reserved|..#.#.Ve|
|000001b0| 72 73 69 6f 6e 73 3a 09 | 0d 23 09 09 09 31 2e 30 |rsions:.|.#...1.0|
|000001c0| 30 20 09 09 09 09 09 30 | 34 2f 38 39 0d 23 0d 23 |0 .....0|4/89.#.#|
|000001d0| 09 43 6f 6d 70 6f 6e 65 | 6e 74 73 3a 0d 23 09 09 |.Compone|nts:.#..|
|000001e0| 09 43 50 6c 75 73 54 45 | 53 61 6d 70 6c 65 2e 6d |.CPlusTE|Sample.m|
|000001f0| 61 6b 65 09 09 41 70 72 | 69 6c 20 31 2c 20 31 39 |ake..Apr|il 1, 19|
|00000200| 38 39 0d 23 09 09 09 54 | 41 70 70 6c 69 63 61 74 |89.#...T|Applicat|
|00000210| 69 6f 6e 43 6f 6d 6d 6f | 6e 2e 68 09 41 70 72 69 |ionCommo|n.h.Apri|
|00000220| 6c 20 31 2c 20 31 39 38 | 39 0d 23 09 09 09 54 41 |l 1, 198|9.#...TA|
|00000230| 70 70 6c 69 63 61 74 69 | 6f 6e 2e 68 09 09 09 41 |pplicati|on.h...A|
|00000240| 70 72 69 6c 20 31 2c 20 | 31 39 38 39 0d 23 09 09 |pril 1, |1989.#..|
|00000250| 09 54 44 6f 63 75 6d 65 | 6e 74 2e 68 09 09 09 09 |.TDocume|nt.h....|
|00000260| 41 70 72 69 6c 20 31 2c | 20 31 39 38 39 0d 23 09 |April 1,| 1989.#.|
|00000270| 09 09 54 45 43 6f 6d 6d | 6f 6e 2e 68 09 09 09 09 |..TEComm|on.h....|
|00000280| 41 70 72 69 6c 20 31 2c | 20 31 39 38 39 0d 23 09 |April 1,| 1989.#.|
|00000290| 09 09 54 45 53 61 6d 70 | 6c 65 2e 68 09 09 09 09 |..TESamp|le.h....|
|000002a0| 41 70 72 69 6c 20 31 2c | 20 31 39 38 39 0d 23 09 |April 1,| 1989.#.|
|000002b0| 09 09 54 45 44 6f 63 75 | 6d 65 6e 74 2e 68 09 09 |..TEDocu|ment.h..|
|000002c0| 09 41 70 72 69 6c 20 31 | 2c 20 31 39 38 39 0d 23 |.April 1|, 1989.#|
|000002d0| 09 09 09 54 41 70 70 6c | 69 63 61 74 69 6f 6e 2e |...TAppl|ication.|
|000002e0| 63 70 09 09 09 41 70 72 | 69 6c 20 31 2c 20 31 39 |cp...Apr|il 1, 19|
|000002f0| 38 39 0d 23 09 09 09 54 | 44 6f 63 75 6d 65 6e 74 |89.#...T|Document|
|00000300| 2e 63 70 09 09 09 41 70 | 72 69 6c 20 31 2c 20 31 |.cp...Ap|ril 1, 1|
|00000310| 39 38 39 0d 23 09 09 09 | 54 45 53 61 6d 70 6c 65 |989.#...|TESample|
|00000320| 2e 63 70 09 09 09 09 41 | 70 72 69 6c 20 31 2c 20 |.cp....A|pril 1, |
|00000330| 31 39 38 39 0d 23 09 09 | 09 54 45 44 6f 63 75 6d |1989.#..|.TEDocum|
|00000340| 65 6e 74 2e 63 70 09 09 | 09 41 70 72 69 6c 20 31 |ent.cp..|.April 1|
|00000350| 2c 20 31 39 38 39 0d 23 | 09 09 09 54 45 53 61 6d |, 1989.#|...TESam|
|00000360| 70 6c 65 47 6c 75 65 2e | 61 09 09 09 41 70 72 69 |pleGlue.|a...Apri|
|00000370| 6c 20 31 2c 20 31 39 38 | 39 0d 23 09 09 09 54 41 |l 1, 198|9.#...TA|
|00000380| 70 70 6c 69 63 61 74 69 | 6f 6e 2e 72 09 09 09 41 |pplicati|on.r...A|
|00000390| 70 72 69 6c 20 31 2c 20 | 31 39 38 39 0d 23 09 09 |pril 1, |1989.#..|
|000003a0| 09 54 45 53 61 6d 70 6c | 65 2e 72 09 09 09 09 41 |.TESampl|e.r....A|
|000003b0| 70 72 69 6c 20 31 2c 20 | 31 39 38 39 0d 23 0d 23 |pril 1, |1989.#.#|
|000003c0| 09 43 50 6c 75 73 54 45 | 53 61 6d 70 6c 65 20 69 |.CPlusTE|Sample i|
|000003d0| 73 20 61 6e 20 65 78 61 | 6d 70 6c 65 20 61 70 70 |s an exa|mple app|
|000003e0| 6c 69 63 61 74 69 6f 6e | 20 74 68 61 74 20 64 65 |lication| that de|
|000003f0| 6d 6f 6e 73 74 72 61 74 | 65 73 0d 23 09 68 6f 77 |monstrat|es.#.how|
|00000400| 20 74 6f 20 69 6e 69 74 | 69 61 6c 69 7a 65 20 74 | to init|ialize t|
|00000410| 68 65 20 63 6f 6d 6d 6f | 6e 6c 79 20 75 73 65 64 |he commo|nly used|
|00000420| 20 74 6f 6f 6c 62 6f 78 | 20 6d 61 6e 61 67 65 72 | toolbox| manager|
|00000430| 73 2c 0d 23 09 6f 70 65 | 72 61 74 65 20 73 75 63 |s,.#.ope|rate suc|
|00000440| 63 65 73 73 66 75 6c 6c | 79 20 75 6e 64 65 72 20 |cessfull|y under |
|00000450| 4d 75 6c 74 69 46 69 6e | 64 65 72 2c 20 68 61 6e |MultiFin|der, han|
|00000460| 64 6c 65 20 64 65 73 6b | 0d 23 09 61 63 63 65 73 |dle desk|.#.acces|
|00000470| 73 6f 72 69 65 73 20 61 | 6e 64 20 63 72 65 61 74 |sories a|nd creat|
|00000480| 65 2c 20 67 72 6f 77 2c | 20 61 6e 64 20 7a 6f 6f |e, grow,| and zoo|
|00000490| 6d 20 77 69 6e 64 6f 77 | 73 2e 20 54 68 65 0d 23 |m window|s. The.#|
|000004a0| 09 66 75 6e 64 61 6d 65 | 6e 74 61 6c 20 54 65 78 |.fundame|ntal Tex|
|000004b0| 74 45 64 69 74 20 74 6f | 6f 6c 62 6f 78 20 63 61 |tEdit to|olbox ca|
|000004c0| 6c 6c 73 20 61 6e 64 20 | 54 65 78 74 45 64 69 74 |lls and |TextEdit|
|000004d0| 20 61 75 74 6f 73 63 72 | 6f 6c 6c 0d 23 09 61 72 | autoscr|oll.#.ar|
|000004e0| 65 20 64 65 6d 6f 6e 73 | 74 72 61 74 65 64 2e 20 |e demons|trated. |
|000004f0| 49 74 20 61 6c 73 6f 20 | 73 68 6f 77 73 20 68 6f |It also |shows ho|
|00000500| 77 20 74 6f 20 63 72 65 | 61 74 65 20 61 6e 64 20 |w to cre|ate and |
|00000510| 6d 61 69 6e 74 61 69 6e | 0d 23 09 73 63 72 6f 6c |maintain|.#.scrol|
|00000520| 6c 62 61 72 20 63 6f 6e | 74 72 6f 6c 73 2e 20 0d |lbar con|trols. .|
|00000530| 23 0d 23 09 54 68 69 73 | 20 76 65 72 73 69 6f 6e |#.#.This| version|
|00000540| 20 6f 66 20 54 45 53 61 | 6d 70 6c 65 20 68 61 73 | of TESa|mple has|
|00000550| 20 62 65 65 6e 20 73 75 | 62 73 74 61 6e 74 69 61 | been su|bstantia|
|00000560| 6c 6c 79 20 72 65 77 6f | 72 6b 65 64 20 69 6e 0d |lly rewo|rked in.|
|00000570| 23 09 43 2b 2b 20 74 6f | 20 73 68 6f 77 20 68 6f |#.C++ to| show ho|
|00000580| 77 20 61 20 22 74 79 70 | 69 63 61 6c 22 20 6f 62 |w a "typ|ical" ob|
|00000590| 6a 65 63 74 20 6f 72 69 | 65 6e 74 65 64 20 70 72 |ject ori|ented pr|
|000005a0| 6f 67 72 61 6d 20 63 6f | 75 6c 64 0d 23 09 62 65 |ogram co|uld.#.be|
|000005b0| 20 77 72 69 74 74 65 6e | 2e 20 54 6f 20 74 68 69 | written|. To thi|
|000005c0| 73 20 65 6e 64 2c 20 77 | 68 61 74 20 77 61 73 20 |s end, w|hat was |
|000005d0| 6f 6e 63 65 20 61 20 73 | 69 6e 67 6c 65 20 73 6f |once a s|ingle so|
|000005e0| 75 72 63 65 20 63 6f 64 | 65 0d 23 09 66 69 6c 65 |urce cod|e.#.file|
|000005f0| 20 68 61 73 20 62 65 65 | 6e 20 72 65 73 74 72 75 | has bee|n restru|
|00000600| 63 74 75 72 65 64 20 69 | 6e 74 6f 20 61 20 73 65 |ctured i|nto a se|
|00000610| 74 20 6f 66 20 63 6c 61 | 73 73 65 73 20 77 68 69 |t of cla|sses whi|
|00000620| 63 68 0d 23 09 64 65 6d | 6f 6e 73 74 72 61 74 65 |ch.#.dem|onstrate|
|00000630| 20 74 68 65 20 61 64 76 | 61 6e 74 61 67 65 73 20 | the adv|antages |
|00000640| 6f 66 20 6f 62 6a 65 63 | 74 2d 6f 72 69 65 6e 74 |of objec|t-orient|
|00000650| 65 64 20 70 72 6f 67 72 | 61 6d 6d 69 6e 67 2e 0d |ed progr|amming..|
|00000660| 23 0d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |#.------|--------|
|00000670| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000680| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000690| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000006a0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000006b0| 2a 2f 0d 0d 0d 2f 2a 0d | 53 65 67 6d 65 6e 74 61 |*/.../*.|Segmenta|
|000006c0| 74 69 6f 6e 20 73 74 72 | 61 74 65 67 79 3a 0d 0d |tion str|ategy:..|
|000006d0| 20 20 20 20 54 68 69 73 | 20 70 72 6f 67 72 61 6d | This| program|
|000006e0| 20 68 61 73 20 6f 6e 6c | 79 20 6f 6e 65 20 73 65 | has onl|y one se|
|000006f0| 67 6d 65 6e 74 2c 20 73 | 69 6e 63 65 20 74 68 65 |gment, s|ince the|
|00000700| 20 69 73 73 75 65 73 0d | 20 20 20 20 73 75 72 72 | issues.| surr|
|00000710| 6f 75 6e 64 69 6e 67 20 | 73 65 67 6d 65 6e 74 61 |ounding |segmenta|
|00000720| 74 69 6f 6e 20 77 69 74 | 68 69 6e 20 61 20 63 6c |tion wit|hin a cl|
|00000730| 61 73 73 27 73 20 6d 65 | 74 68 6f 64 73 20 68 61 |ass's me|thods ha|
|00000740| 76 65 0d 20 20 20 20 6e | 6f 74 20 62 65 65 6e 20 |ve. n|ot been |
|00000750| 69 6e 76 65 73 74 69 67 | 61 74 65 64 20 79 65 74 |investig|ated yet|
|00000760| 2e 20 57 65 20 44 4f 20 | 75 6e 6c 6f 61 64 20 74 |. We DO |unload t|
|00000770| 68 65 20 64 61 74 61 0d | 20 20 20 20 69 6e 69 74 |he data.| init|
|00000780| 69 61 6c 69 7a 61 74 69 | 6f 6e 20 73 65 67 6d 65 |ializati|on segme|
|00000790| 6e 74 20 61 74 20 73 74 | 61 72 74 75 70 20 74 69 |nt at st|artup ti|
|000007a0| 6d 65 2c 20 77 68 69 63 | 68 20 66 72 65 65 73 20 |me, whic|h frees |
|000007b0| 75 70 0d 20 20 20 20 73 | 6f 6d 65 20 6d 65 6d 6f |up. s|ome memo|
|000007c0| 72 79 20 0d 0d 53 65 74 | 50 6f 72 74 20 73 74 72 |ry ..Set|Port str|
|000007d0| 61 74 65 67 79 3a 0d 0d | 20 20 20 20 54 6f 6f 6c |ategy:..| Tool|
|000007e0| 62 6f 78 20 72 6f 75 74 | 69 6e 65 73 20 64 6f 20 |box rout|ines do |
|000007f0| 6e 6f 74 20 63 68 61 6e | 67 65 20 74 68 65 20 63 |not chan|ge the c|
|00000800| 75 72 72 65 6e 74 20 70 | 6f 72 74 2e 20 49 6e 0d |urrent p|ort. In.|
|00000810| 20 20 20 20 73 70 69 74 | 65 20 6f 66 20 74 68 69 | spit|e of thi|
|00000820| 73 2c 20 69 6e 20 74 68 | 69 73 20 70 72 6f 67 72 |s, in th|is progr|
|00000830| 61 6d 20 77 65 20 75 73 | 65 20 61 20 73 74 72 61 |am we us|e a stra|
|00000840| 74 65 67 79 20 6f 66 0d | 20 20 20 20 63 61 6c 6c |tegy of.| call|
|00000850| 69 6e 67 20 53 65 74 50 | 6f 72 74 20 77 68 65 6e |ing SetP|ort when|
|00000860| 65 76 65 72 20 77 65 20 | 77 61 6e 74 20 74 6f 20 |ever we |want to |
|00000870| 64 72 61 77 20 6f 72 20 | 6d 61 6b 65 20 63 61 6c |draw or |make cal|
|00000880| 6c 73 0d 20 20 20 20 77 | 68 69 63 68 20 64 65 70 |ls. w|hich dep|
|00000890| 65 6e 64 20 6f 6e 20 74 | 68 65 20 63 75 72 72 65 |end on t|he curre|
|000008a0| 6e 74 20 70 6f 72 74 2e | 20 54 68 69 73 20 6d 61 |nt port.| This ma|
|000008b0| 6b 65 73 20 75 73 20 6c | 65 73 73 0d 20 20 20 20 |kes us l|ess. |
|000008c0| 76 75 6c 6e 65 72 61 62 | 6c 65 20 74 6f 20 62 75 |vulnerab|le to bu|
|000008d0| 67 73 20 69 6e 20 6f 74 | 68 65 72 20 73 6f 66 74 |gs in ot|her soft|
|000008e0| 77 61 72 65 20 77 68 69 | 63 68 20 6d 69 67 68 74 |ware whi|ch might|
|000008f0| 20 61 6c 74 65 72 0d 20 | 20 20 20 74 68 65 20 63 | alter. | the c|
|00000900| 75 72 72 65 6e 74 20 70 | 6f 72 74 20 28 73 75 63 |urrent p|ort (suc|
|00000910| 68 20 61 73 20 74 68 65 | 20 62 75 67 20 28 66 65 |h as the| bug (fe|
|00000920| 61 74 75 72 65 3f 29 20 | 69 6e 20 6d 61 6e 79 0d |ature?) |in many.|
|00000930| 20 20 20 20 64 65 73 6b | 20 61 63 63 65 73 73 6f | desk| accesso|
|00000940| 72 69 65 73 20 77 68 69 | 63 68 20 63 68 61 6e 67 |ries whi|ch chang|
|00000950| 65 20 74 68 65 20 70 6f | 72 74 20 6f 6e 20 4f 70 |e the po|rt on Op|
|00000960| 65 6e 44 65 73 6b 41 63 | 63 29 2e 0d 20 20 20 20 |enDeskAc|c).. |
|00000970| 48 6f 70 65 66 75 6c 6c | 79 2c 20 74 68 69 73 20 |Hopefull|y, this |
|00000980| 61 6c 73 6f 20 6d 61 6b | 65 73 20 74 68 65 20 72 |also mak|es the r|
|00000990| 6f 75 74 69 6e 65 73 20 | 66 72 6f 6d 20 74 68 69 |outines |from thi|
|000009a0| 73 0d 20 20 20 20 70 72 | 6f 67 72 61 6d 20 6d 6f |s. pr|ogram mo|
|000009b0| 72 65 20 73 65 6c 66 2d | 63 6f 6e 74 61 69 6e 65 |re self-|containe|
|000009c0| 64 2c 20 73 69 6e 63 65 | 20 74 68 65 79 20 64 6f |d, since| they do|
|000009d0| 6e 27 74 20 64 65 70 65 | 6e 64 20 6f 6e 0d 20 20 |n't depe|nd on. |
|000009e0| 20 20 74 68 65 20 63 75 | 72 72 65 6e 74 20 70 6f | the cu|rrent po|
|000009f0| 72 74 20 73 65 74 74 69 | 6e 67 2e 20 0d 0d 43 6c |rt setti|ng. ..Cl|
|00000a00| 69 70 62 6f 61 72 64 20 | 73 74 72 61 74 65 67 79 |ipboard |strategy|
|00000a10| 3a 0d 0d 20 20 20 20 54 | 68 69 73 20 70 72 6f 67 |:.. T|his prog|
|00000a20| 72 61 6d 20 64 6f 65 73 | 20 6e 6f 74 20 6d 61 69 |ram does| not mai|
|00000a30| 6e 74 61 69 6e 20 61 20 | 70 72 69 76 61 74 65 20 |ntain a |private |
|00000a40| 73 63 72 61 70 2e 0d 20 | 20 20 20 57 68 65 6e 65 |scrap.. | Whene|
|00000a50| 76 65 72 20 61 20 63 75 | 74 2c 20 63 6f 70 79 2c |ver a cu|t, copy,|
|00000a60| 20 6f 72 20 70 61 73 74 | 65 20 6f 63 63 75 72 73 | or past|e occurs|
|00000a70| 2c 20 77 65 20 69 6d 70 | 6f 72 74 2f 65 78 70 6f |, we imp|ort/expo|
|00000a80| 72 74 0d 20 20 20 20 66 | 72 6f 6d 20 74 68 65 20 |rt. f|rom the |
|00000a90| 70 75 62 6c 69 63 20 73 | 63 72 61 70 20 74 6f 20 |public s|crap to |
|00000aa0| 54 65 78 74 45 64 69 74 | 27 73 20 73 63 72 61 70 |TextEdit|'s scrap|
|00000ab0| 20 72 69 67 68 74 20 61 | 77 61 79 2c 0d 20 20 20 | right a|way,. |
|00000ac0| 20 75 73 69 6e 67 20 74 | 68 65 20 54 45 54 6f 53 | using t|he TEToS|
|00000ad0| 63 72 61 70 20 61 6e 64 | 20 54 45 46 72 6f 6d 53 |crap and| TEFromS|
|00000ae0| 63 72 61 70 20 72 6f 75 | 74 69 6e 65 73 2e 20 49 |crap rou|tines. I|
|00000af0| 66 20 77 65 20 64 69 64 | 0d 20 20 20 20 75 73 65 |f we did|. use|
|00000b00| 20 61 20 70 72 69 76 61 | 74 65 20 73 63 72 61 70 | a priva|te scrap|
|00000b10| 2c 20 74 68 65 20 69 6d | 70 6f 72 74 2f 65 78 70 |, the im|port/exp|
|00000b20| 6f 72 74 20 77 6f 75 6c | 64 20 62 65 20 69 6e 20 |ort woul|d be in |
|00000b30| 74 68 65 0d 20 20 20 20 | 61 63 74 69 76 61 74 65 |the. |activate|
|00000b40| 2f 64 65 61 63 74 69 76 | 61 74 65 20 65 76 65 6e |/deactiv|ate even|
|00000b50| 74 20 61 6e 64 20 73 75 | 73 70 65 6e 64 2f 72 65 |t and su|spend/re|
|00000b60| 73 75 6d 65 20 65 76 65 | 6e 74 0d 20 20 20 20 72 |sume eve|nt. r|
|00000b70| 6f 75 74 69 6e 65 73 2e | 20 0d 2a 2f 0d 0d 23 69 |outines.| .*/..#i|
|00000b80| 6e 63 6c 75 64 65 20 3c | 54 79 70 65 73 2e 68 3e |nclude <|Types.h>|
|00000b90| 0d 23 69 6e 63 6c 75 64 | 65 20 3c 51 75 69 63 6b |.#includ|e <Quick|
|00000ba0| 44 72 61 77 2e 68 3e 0d | 23 69 6e 63 6c 75 64 65 |Draw.h>.|#include|
|00000bb0| 20 3c 46 6f 6e 74 73 2e | 68 3e 0d 23 69 6e 63 6c | <Fonts.|h>.#incl|
|00000bc0| 75 64 65 20 3c 45 76 65 | 6e 74 73 2e 68 3e 0d 23 |ude <Eve|nts.h>.#|
|00000bd0| 69 6e 63 6c 75 64 65 20 | 3c 43 6f 6e 74 72 6f 6c |include |<Control|
|00000be0| 73 2e 68 3e 0d 23 69 6e | 63 6c 75 64 65 20 3c 57 |s.h>.#in|clude <W|
|00000bf0| 69 6e 64 6f 77 73 2e 68 | 3e 0d 23 69 6e 63 6c 75 |indows.h|>.#inclu|
|00000c00| 64 65 20 3c 4d 65 6e 75 | 73 2e 68 3e 0d 23 69 6e |de <Menu|s.h>.#in|
|00000c10| 63 6c 75 64 65 20 3c 54 | 65 78 74 45 64 69 74 2e |clude <T|extEdit.|
|00000c20| 68 3e 0d 23 69 6e 63 6c | 75 64 65 20 3c 44 69 61 |h>.#incl|ude <Dia|
|00000c30| 6c 6f 67 73 2e 68 3e 0d | 23 69 6e 63 6c 75 64 65 |logs.h>.|#include|
|00000c40| 20 3c 44 65 73 6b 2e 68 | 3e 0d 23 69 6e 63 6c 75 | <Desk.h|>.#inclu|
|00000c50| 64 65 20 3c 53 63 72 61 | 70 2e 68 3e 0d 23 69 6e |de <Scra|p.h>.#in|
|00000c60| 63 6c 75 64 65 20 3c 54 | 6f 6f 6c 55 74 69 6c 73 |clude <T|oolUtils|
|00000c70| 2e 68 3e 0d 23 69 6e 63 | 6c 75 64 65 20 3c 4d 65 |.h>.#inc|lude <Me|
|00000c80| 6d 6f 72 79 2e 68 3e 0d | 23 69 6e 63 6c 75 64 65 |mory.h>.|#include|
|00000c90| 20 3c 53 65 67 4c 6f 61 | 64 2e 68 3e 0d 23 69 6e | <SegLoa|d.h>.#in|
|00000ca0| 63 6c 75 64 65 20 3c 46 | 69 6c 65 73 2e 68 3e 0d |clude <F|iles.h>.|
|00000cb0| 23 69 6e 63 6c 75 64 65 | 20 3c 4f 53 55 74 69 6c |#include| <OSUtil|
|00000cc0| 73 2e 68 3e 0d 23 69 6e | 63 6c 75 64 65 20 3c 54 |s.h>.#in|clude <T|
|00000cd0| 72 61 70 73 2e 68 3e 0d | 0d 2f 2f 20 6f 75 72 20 |raps.h>.|.// our |
|00000ce0| 63 6c 61 73 73 20 64 65 | 66 69 6e 69 74 69 6f 6e |class de|finition|
|00000cf0| 73 0d 23 69 6e 63 6c 75 | 64 65 20 22 54 45 44 6f |s.#inclu|de "TEDo|
|00000d00| 63 75 6d 65 6e 74 2e 68 | 22 0d 23 69 6e 63 6c 75 |cument.h|".#inclu|
|00000d10| 64 65 20 22 54 45 53 61 | 6d 70 6c 65 2e 68 22 0d |de "TESa|mple.h".|
|00000d20| 0d 2f 2f 20 45 78 74 72 | 65 6d 65 4e 65 67 20 61 |.// Extr|emeNeg a|
|00000d30| 6e 64 20 45 78 74 72 65 | 6d 65 50 6f 73 20 61 72 |nd Extre|mePos ar|
|00000d40| 65 20 75 73 65 64 20 74 | 6f 20 73 65 74 20 75 70 |e used t|o set up|
|00000d50| 20 77 69 64 65 20 6f 70 | 65 6e 20 72 65 63 74 61 | wide op|en recta|
|00000d60| 6e 67 6c 65 73 20 61 6e | 64 20 72 65 67 69 6f 6e |ngles an|d region|
|00000d70| 73 2e 0d 63 6f 6e 73 74 | 20 73 68 6f 72 74 20 6b |s..const| short k|
|00000d80| 45 78 74 72 65 6d 65 4e | 65 67 20 3d 20 2d 33 32 |ExtremeN|eg = -32|
|00000d90| 37 36 38 3b 0d 63 6f 6e | 73 74 20 73 68 6f 72 74 |768;.con|st short|
|00000da0| 20 6b 45 78 74 72 65 6d | 65 50 6f 73 20 3d 20 33 | kExtrem|ePos = 3|
|00000db0| 32 37 36 37 20 2d 20 31 | 3b 20 2f 2f 20 72 65 71 |2767 - 1|; // req|
|00000dc0| 75 69 72 65 64 20 74 6f | 20 61 64 64 72 65 73 73 |uired to| address|
|00000dd0| 20 61 6e 20 6f 6c 64 20 | 72 65 67 69 6f 6e 20 62 | an old |region b|
|00000de0| 75 67 0d 0d 2f 2f 20 6b | 4d 61 78 4f 70 65 6e 44 |ug..// k|MaxOpenD|
|00000df0| 6f 63 75 6d 65 6e 74 73 | 20 69 73 20 75 73 65 64 |ocuments| is used|
|00000e00| 20 74 6f 20 64 65 74 65 | 72 6d 69 6e 65 20 77 68 | to dete|rmine wh|
|00000e10| 65 74 68 65 72 20 61 20 | 6e 65 77 20 64 6f 63 75 |ether a |new docu|
|00000e20| 6d 65 6e 74 20 63 61 6e | 20 62 65 20 6f 70 65 6e |ment can| be open|
|00000e30| 65 64 0d 2f 2f 20 6f 72 | 20 63 72 65 61 74 65 64 |ed.// or| created|
|00000e40| 2e 20 57 65 20 6b 65 65 | 70 20 74 72 61 63 6b 20 |. We kee|p track |
|00000e50| 6f 66 20 74 68 65 20 6e | 75 6d 62 65 72 20 6f 66 |of the n|umber of|
|00000e60| 20 6f 70 65 6e 20 64 6f | 63 75 6d 65 6e 74 73 2c | open do|cuments,|
|00000e70| 20 61 6e 64 20 64 69 73 | 61 62 6c 65 20 74 68 65 | and dis|able the|
|00000e80| 0d 2f 2f 20 6d 65 6e 75 | 20 69 74 65 6d 73 20 74 |.// menu| items t|
|00000e90| 68 61 74 20 63 72 65 61 | 74 65 20 61 20 6e 65 77 |hat crea|te a new|
|00000ea0| 20 64 6f 63 75 6d 65 6e | 74 20 77 68 65 6e 20 74 | documen|t when t|
|00000eb0| 68 65 20 6d 61 78 69 6d | 75 6d 20 69 73 20 72 65 |he maxim|um is re|
|00000ec0| 61 63 68 65 64 2e 20 49 | 66 20 74 68 65 0d 2f 2f |ached. I|f the.//|
|00000ed0| 20 6e 75 6d 62 65 72 20 | 6f 66 20 64 6f 63 75 6d | number |of docum|
|00000ee0| 65 6e 74 73 20 66 61 6c | 6c 73 20 62 65 6c 6f 77 |ents fal|ls below|
|00000ef0| 20 74 68 65 20 6d 61 78 | 69 6d 75 6d 2c 20 74 68 | the max|imum, th|
|00000f00| 65 20 69 74 65 6d 73 20 | 61 72 65 20 65 6e 61 62 |e items |are enab|
|00000f10| 6c 65 64 20 61 67 61 69 | 6e 2e 20 2a 2f 0d 63 6f |led agai|n. */.co|
|00000f20| 6e 73 74 20 73 68 6f 72 | 74 09 6b 4d 61 78 4f 70 |nst shor|t.kMaxOp|
|00000f30| 65 6e 44 6f 63 75 6d 65 | 6e 74 73 20 3d 20 31 3b |enDocume|nts = 1;|
|00000f40| 0d 09 0d 2f 2f 20 44 65 | 66 69 6e 65 20 6d 61 78 |...// De|fine max|
|00000f50| 2c 20 6d 69 6e 2c 20 48 | 69 57 72 64 20 61 6e 64 |, min, H|iWrd and|
|00000f60| 20 4c 6f 57 72 64 20 6d | 61 63 72 6f 73 20 66 6f | LoWrd m|acros fo|
|00000f70| 72 20 65 66 66 69 63 69 | 65 6e 63 79 2e 0d 23 64 |r effici|ency..#d|
|00000f80| 65 66 69 6e 65 20 6d 61 | 78 28 61 2c 62 29 09 09 |efine ma|x(a,b)..|
|00000f90| 28 28 61 29 20 3e 20 28 | 62 29 20 3f 20 28 61 29 |((a) > (|b) ? (a)|
|00000fa0| 20 3a 20 28 62 29 29 0d | 23 64 65 66 69 6e 65 20 | : (b)).|#define |
|00000fb0| 6d 69 6e 28 61 2c 62 29 | 09 09 28 28 61 29 20 3c |min(a,b)|..((a) <|
|00000fc0| 20 28 62 29 20 3f 20 28 | 61 29 20 3a 20 28 62 29 | (b) ? (|a) : (b)|
|00000fd0| 29 0d 23 64 65 66 69 6e | 65 20 48 69 57 72 64 28 |).#defin|e HiWrd(|
|00000fe0| 61 4c 6f 6e 67 29 09 28 | 28 28 61 4c 6f 6e 67 29 |aLong).(|((aLong)|
|00000ff0| 20 3e 3e 20 31 36 29 20 | 26 20 30 78 46 46 46 46 | >> 16) |& 0xFFFF|
|00001000| 29 0d 23 64 65 66 69 6e | 65 20 4c 6f 57 72 64 28 |).#defin|e LoWrd(|
|00001010| 61 4c 6f 6e 67 29 09 28 | 28 61 4c 6f 6e 67 29 20 |aLong).(|(aLong) |
|00001020| 26 20 30 78 46 46 46 46 | 29 0d 0d 2f 2f 20 4f 75 |& 0xFFFF|)..// Ou|
|00001030| 72 20 61 70 70 6c 69 63 | 61 74 69 6f 6e 20 6f 62 |r applic|ation ob|
|00001040| 6a 65 63 74 2c 20 69 6e | 69 74 69 61 6c 69 7a 65 |ject, in|itialize|
|00001050| 64 20 69 6e 20 6d 61 69 | 6e 28 29 2e 20 57 65 20 |d in mai|n(). We |
|00001060| 6d 61 6b 65 20 69 74 0d | 2f 2f 20 67 6c 6f 62 61 |make it.|// globa|
|00001070| 6c 20 73 6f 20 6f 75 72 | 20 66 75 6e 63 74 69 6f |l so our| functio|
|00001080| 6e 73 20 77 68 69 63 68 | 20 64 6f 6e 27 74 20 62 |ns which| don't b|
|00001090| 65 6c 6f 6e 67 20 74 6f | 20 61 6e 79 20 63 6c 61 |elong to| any cla|
|000010a0| 73 73 0d 2f 2f 20 63 61 | 6e 20 66 69 6e 64 20 74 |ss.// ca|n find t|
|000010b0| 68 65 20 61 63 74 69 76 | 65 20 64 6f 63 75 6d 65 |he activ|e docume|
|000010c0| 6e 74 2e 0d 54 45 53 61 | 6d 70 6c 65 20 2a 67 54 |nt..TESa|mple *gT|
|000010d0| 68 65 41 70 70 6c 69 63 | 61 74 69 6f 6e 3b 0d 0d |heApplic|ation;..|
|000010e0| 2f 2f 20 6d 61 69 6e 20 | 69 73 20 74 68 65 20 65 |// main |is the e|
|000010f0| 6e 74 72 79 70 6f 69 6e | 74 20 74 6f 20 74 68 65 |ntrypoin|t to the|
|00001100| 20 70 72 6f 67 72 61 6d | 0d 69 6e 74 20 6d 61 69 | program|.int mai|
|00001110| 6e 28 76 6f 69 64 29 0d | 7b 0d 09 2f 2f 20 43 72 |n(void).|{..// Cr|
|00001120| 65 61 74 65 20 6f 75 72 | 20 61 70 70 6c 69 63 61 |eate our| applica|
|00001130| 74 69 6f 6e 20 6f 62 6a | 65 63 74 2e 20 54 68 69 |tion obj|ect. Thi|
|00001140| 73 20 4d 55 53 54 20 62 | 65 20 74 68 65 20 46 49 |s MUST b|e the FI|
|00001150| 52 53 54 20 74 68 69 6e | 67 0d 09 2f 2f 20 64 6f |RST thin|g..// do|
|00001160| 6e 65 20 69 6e 20 6d 61 | 69 6e 28 29 2c 20 73 69 |ne in ma|in(), si|
|00001170| 6e 63 65 20 69 74 20 69 | 6e 69 74 69 61 6c 69 7a |nce it i|nitializ|
|00001180| 65 73 20 74 68 65 20 54 | 6f 6f 6c 62 6f 78 20 66 |es the T|oolbox f|
|00001190| 6f 72 20 75 73 2e 0d 09 | 67 54 68 65 41 70 70 6c |or us...|gTheAppl|
|000011a0| 69 63 61 74 69 6f 6e 20 | 3d 20 6e 65 77 20 54 45 |ication |= new TE|
|000011b0| 53 61 6d 70 6c 65 3b 0d | 09 69 66 20 28 67 54 68 |Sample;.|.if (gTh|
|000011c0| 65 41 70 70 6c 69 63 61 | 74 69 6f 6e 20 3d 3d 20 |eApplica|tion == |
|000011d0| 6e 69 6c 29 09 09 2f 2f | 20 69 66 20 77 65 20 63 |nil)..//| if we c|
|000011e0| 6f 75 6c 64 6e 27 74 20 | 61 6c 6c 6f 63 61 74 65 |ouldn't |allocate|
|000011f0| 20 6f 62 6a 65 63 74 20 | 28 69 6d 70 6f 73 73 69 | object |(impossi|
|00001200| 62 6c 65 21 3f 29 0d 09 | 20 20 72 65 74 75 72 6e |ble!?)..| return|
|00001210| 20 30 3b 09 09 09 09 09 | 09 2f 2f 20 67 6f 20 62 | 0;.....|.// go b|
|00001220| 61 63 6b 20 74 6f 20 46 | 69 6e 64 65 72 0d 09 0d |ack to F|inder...|
|00001230| 09 2f 2f 20 53 74 61 72 | 74 20 6f 75 72 20 6d 61 |.// Star|t our ma|
|00001240| 69 6e 20 65 76 65 6e 74 | 20 6c 6f 6f 70 20 72 75 |in event| loop ru|
|00001250| 6e 6e 69 6e 67 2e 20 54 | 68 69 73 20 77 6f 6e 27 |nning. T|his won'|
|00001260| 74 20 72 65 74 75 72 6e | 20 75 6e 74 69 6c 20 75 |t return| until u|
|00001270| 73 65 72 20 71 75 69 74 | 73 0d 09 67 54 68 65 41 |ser quit|s..gTheA|
|00001280| 70 70 6c 69 63 61 74 69 | 6f 6e 2d 3e 45 76 65 6e |pplicati|on->Even|
|00001290| 74 4c 6f 6f 70 28 29 3b | 0d 0d 09 2f 2f 20 57 65 |tLoop();|...// We|
|000012a0| 20 61 6c 77 61 79 73 20 | 72 65 74 75 72 6e 20 61 | always |return a|
|000012b0| 20 76 61 6c 75 65 2c 20 | 6c 69 6b 65 20 67 6f 6f | value, |like goo|
|000012c0| 64 20 6c 69 74 74 6c 65 | 20 41 4e 53 49 20 77 6f |d little| ANSI wo|
|000012d0| 72 73 68 69 70 70 65 72 | 73 0d 09 72 65 74 75 72 |rshipper|s..retur|
|000012e0| 6e 20 30 3b 0d 7d 0d 0d | 2f 2f 20 74 68 65 20 63 |n 0;.}..|// the c|
|000012f0| 6f 6e 73 74 72 75 63 74 | 6f 72 20 66 6f 72 20 6f |onstruct|or for o|
|00001300| 75 72 20 63 6c 61 73 73 | 2c 20 63 61 6c 6c 65 64 |ur class|, called|
|00001310| 20 61 75 74 6f 6d 61 74 | 69 63 61 6c 6c 79 20 77 | automat|ically w|
|00001320| 68 65 6e 20 77 65 20 63 | 72 65 61 74 65 0d 2f 2f |hen we c|reate.//|
|00001330| 20 61 6e 20 69 6e 73 74 | 61 6e 63 65 20 6f 66 20 | an inst|ance of |
|00001340| 74 68 69 73 20 63 6c 61 | 73 73 2e 20 49 6e 20 74 |this cla|ss. In t|
|00001350| 68 69 73 20 70 61 72 74 | 69 63 75 6c 61 72 20 63 |his part|icular c|
|00001360| 61 73 65 2c 20 77 65 20 | 6f 6e 6c 79 20 77 61 6e |ase, we |only wan|
|00001370| 74 0d 2f 2f 20 6f 6e 65 | 20 69 6e 73 74 61 6e 63 |t.// one| instanc|
|00001380| 65 20 73 69 6e 63 65 20 | 74 68 65 20 63 6f 6e 73 |e since |the cons|
|00001390| 74 72 75 63 74 6f 72 20 | 64 6f 65 73 20 61 6c 6c |tructor |does all|
|000013a0| 20 74 68 65 20 6d 65 6e | 75 20 73 65 74 75 70 73 | the men|u setups|
|000013b0| 20 61 6e 64 0d 2f 2f 20 | 63 72 65 61 74 65 73 20 | and.// |creates |
|000013c0| 6f 75 72 20 28 75 6e 74 | 69 74 6c 65 64 29 20 64 |our (unt|itled) d|
|000013d0| 6f 63 75 6d 65 6e 74 2e | 0d 54 45 53 61 6d 70 6c |ocument.|.TESampl|
|000013e0| 65 3a 3a 54 45 53 61 6d | 70 6c 65 28 76 6f 69 64 |e::TESam|ple(void|
|000013f0| 29 0d 7b 0d 09 48 61 6e | 64 6c 65 09 6d 65 6e 75 |).{..Han|dle.menu|
|00001400| 42 61 72 3b 0d 0d 09 2f | 2f 20 72 65 61 64 20 6d |Bar;.../|/ read m|
|00001410| 65 6e 75 73 20 69 6e 74 | 6f 20 6d 65 6e 75 20 62 |enus int|o menu b|
|00001420| 61 72 0d 09 6d 65 6e 75 | 42 61 72 20 3d 20 47 65 |ar..menu|Bar = Ge|
|00001430| 74 4e 65 77 4d 42 61 72 | 28 72 4d 65 6e 75 42 61 |tNewMBar|(rMenuBa|
|00001440| 72 29 3b 0d 09 2f 2f 20 | 69 6e 73 74 61 6c 6c 20 |r);..// |install |
|00001450| 6d 65 6e 75 73 0d 09 53 | 65 74 4d 65 6e 75 42 61 |menus..S|etMenuBa|
|00001460| 72 28 6d 65 6e 75 42 61 | 72 29 3b 0d 09 44 69 73 |r(menuBa|r);..Dis|
|00001470| 70 6f 73 48 61 6e 64 6c | 65 28 6d 65 6e 75 42 61 |posHandl|e(menuBa|
|00001480| 72 29 3b 0d 09 2f 2f 20 | 61 64 64 20 44 41 20 6e |r);..// |add DA n|
|00001490| 61 6d 65 73 20 74 6f 20 | 41 70 70 6c 65 20 6d 65 |ames to |Apple me|
|000014a0| 6e 75 0d 09 41 64 64 52 | 65 73 4d 65 6e 75 28 47 |nu..AddR|esMenu(G|
|000014b0| 65 74 4d 48 61 6e 64 6c | 65 28 6d 41 70 70 6c 65 |etMHandl|e(mApple|
|000014c0| 29 2c 20 27 44 52 56 52 | 27 29 3b 0d 09 44 72 61 |), 'DRVR|');..Dra|
|000014d0| 77 4d 65 6e 75 42 61 72 | 28 29 3b 0d 0d 09 2f 2f |wMenuBar|();...//|
|000014e0| 20 63 72 65 61 74 65 20 | 65 6d 70 74 79 20 6d 6f | create |empty mo|
|000014f0| 75 73 65 20 72 65 67 69 | 6f 6e 0d 09 66 4d 6f 75 |use regi|on..fMou|
|00001500| 73 65 52 67 6e 20 3d 20 | 4e 65 77 52 67 6e 28 29 |seRgn = |NewRgn()|
|00001510| 3b 0d 09 2f 2f 20 63 72 | 65 61 74 65 20 61 20 73 |;..// cr|eate a s|
|00001520| 69 6e 67 6c 65 20 65 6d | 70 74 79 20 64 6f 63 75 |ingle em|pty docu|
|00001530| 6d 65 6e 74 0d 09 44 6f | 4e 65 77 28 29 3b 0d 09 |ment..Do|New();..|
|00001540| 2f 2f 20 6d 61 6b 65 20 | 73 75 72 65 20 77 65 20 |// make |sure we |
|00001550| 68 61 76 65 20 61 20 76 | 61 6c 69 64 20 63 75 72 |have a v|alid cur|
|00001560| 73 6f 72 20 72 65 67 69 | 6f 6e 0d 09 41 64 6a 75 |sor regi|on..Adju|
|00001570| 73 74 43 75 72 73 6f 72 | 28 29 3b 0d 7d 0d 0d 2f |stCursor|();.}../|
|00001580| 2f 20 54 65 6c 6c 20 54 | 41 70 70 6c 69 63 61 74 |/ Tell T|Applicat|
|00001590| 69 6f 6e 20 63 6c 61 73 | 73 20 68 6f 77 20 6d 75 |ion clas|s how mu|
|000015a0| 63 68 20 68 65 61 70 20 | 77 65 20 6e 65 65 64 0d |ch heap |we need.|
|000015b0| 6c 6f 6e 67 20 54 45 53 | 61 6d 70 6c 65 3a 3a 48 |long TES|ample::H|
|000015c0| 65 61 70 4e 65 65 64 65 | 64 28 76 6f 69 64 29 0d |eapNeede|d(void).|
|000015d0| 7b 0d 09 72 65 74 75 72 | 6e 20 28 6b 4d 69 6e 53 |{..retur|n (kMinS|
|000015e0| 69 7a 65 20 2a 20 31 30 | 32 34 29 3b 0d 7d 0d 0d |ize * 10|24);.}..|
|000015f0| 2f 2f 20 43 61 6c 63 75 | 6c 61 74 65 20 61 20 73 |// Calcu|late a s|
|00001600| 6c 65 65 70 20 76 61 6c | 75 65 20 66 6f 72 20 57 |leep val|ue for W|
|00001610| 61 69 74 4e 65 78 74 45 | 76 65 6e 74 2e 20 54 68 |aitNextE|vent. Th|
|00001620| 69 73 20 74 61 6b 65 73 | 20 69 6e 74 6f 20 61 63 |is takes| into ac|
|00001630| 63 6f 75 6e 74 20 74 68 | 65 20 74 68 69 6e 67 73 |count th|e things|
|00001640| 0d 2f 2f 20 74 68 61 74 | 20 44 6f 49 64 6c 65 20 |.// that| DoIdle |
|00001650| 64 6f 65 73 20 77 69 74 | 68 20 69 64 6c 65 20 74 |does wit|h idle t|
|00001660| 69 6d 65 2e 0d 0d 75 6e | 73 69 67 6e 65 64 20 6c |ime...un|signed l|
|00001670| 6f 6e 67 20 54 45 53 61 | 6d 70 6c 65 3a 3a 53 6c |ong TESa|mple::Sl|
|00001680| 65 65 70 56 61 6c 28 76 | 6f 69 64 29 0d 7b 0d 09 |eepVal(v|oid).{..|
|00001690| 75 6e 73 69 67 6e 65 64 | 20 6c 6f 6e 67 20 73 6c |unsigned| long sl|
|000016a0| 65 65 70 3b 0d 0d 09 73 | 6c 65 65 70 20 3d 20 6b |eep;...s|leep = k|
|000016b0| 4d 61 78 53 6c 65 65 70 | 54 69 6d 65 3b 09 09 09 |MaxSleep|Time;...|
|000016c0| 09 2f 2f 20 64 65 66 61 | 75 6c 74 20 76 61 6c 75 |.// defa|ult valu|
|000016d0| 65 20 66 6f 72 20 73 6c | 65 65 70 0d 09 2f 2f 20 |e for sl|eep..// |
|000016e0| 69 66 20 77 65 20 61 72 | 65 6e 27 74 20 69 6e 20 |if we ar|en't in |
|000016f0| 62 61 63 6b 67 72 6f 75 | 6e 64 2c 20 6c 65 74 20 |backgrou|nd, let |
|00001700| 64 6f 63 75 6d 65 6e 74 | 20 74 65 6c 6c 20 75 73 |document| tell us|
|00001710| 20 68 6f 77 20 6c 6f 6e | 67 20 74 6f 20 73 6c 65 | how lon|g to sle|
|00001720| 65 70 0d 09 69 66 20 28 | 28 21 66 49 6e 42 61 63 |ep..if (|(!fInBac|
|00001730| 6b 67 72 6f 75 6e 64 29 | 20 26 26 20 28 66 43 75 |kground)| && (fCu|
|00001740| 72 44 6f 63 20 21 3d 20 | 6e 69 6c 29 29 0d 09 20 |rDoc != |nil)).. |
|00001750| 20 73 6c 65 65 70 20 3d | 20 6d 69 6e 28 73 6c 65 | sleep =| min(sle|
|00001760| 65 70 2c 66 43 75 72 44 | 6f 63 2d 3e 43 61 6c 63 |ep,fCurD|oc->Calc|
|00001770| 49 64 6c 65 28 29 29 3b | 0d 09 72 65 74 75 72 6e |Idle());|..return|
|00001780| 20 73 6c 65 65 70 3b 0d | 7d 0d 0d 2f 2f 20 54 68 | sleep;.|}..// Th|
|00001790| 69 73 20 69 73 20 63 61 | 6c 6c 65 64 20 77 68 65 |is is ca|lled whe|
|000017a0| 6e 65 76 65 72 20 77 65 | 20 67 65 74 20 61 20 6e |never we| get a n|
|000017b0| 75 6c 6c 20 65 76 65 6e | 74 20 65 74 20 61 6c 2e |ull even|t et al.|
|000017c0| 0d 2f 2f 20 49 74 20 74 | 61 6b 65 73 20 63 61 72 |.// It t|akes car|
|000017d0| 65 20 6f 66 20 6e 65 63 | 65 73 73 61 72 79 20 70 |e of nec|essary p|
|000017e0| 65 72 69 6f 64 69 63 20 | 61 63 74 69 6f 6e 73 2e |eriodic |actions.|
|000017f0| 20 46 6f 72 20 74 68 69 | 73 20 70 72 6f 67 72 61 | For thi|s progra|
|00001800| 6d 2c 0d 2f 2f 20 69 74 | 20 63 61 6c 6c 73 20 54 |m,.// it| calls T|
|00001810| 45 49 64 6c 65 2e 0d 0d | 76 6f 69 64 20 54 45 53 |EIdle...|void TES|
|00001820| 61 6d 70 6c 65 3a 3a 44 | 6f 49 64 6c 65 28 76 6f |ample::D|oIdle(vo|
|00001830| 69 64 29 0d 7b 0d 09 54 | 45 44 6f 63 75 6d 65 6e |id).{..T|EDocumen|
|00001840| 74 2a 20 66 54 45 43 75 | 72 44 6f 63 20 3d 20 28 |t* fTECu|rDoc = (|
|00001850| 54 45 44 6f 63 75 6d 65 | 6e 74 2a 29 20 66 43 75 |TEDocume|nt*) fCu|
|00001860| 72 44 6f 63 3b 0d 0d 09 | 69 66 20 28 20 66 54 45 |rDoc;...|if ( fTE|
|00001870| 43 75 72 44 6f 63 20 21 | 3d 20 6e 69 6c 20 29 0d |CurDoc !|= nil ).|
|00001880| 09 20 20 66 54 45 43 75 | 72 44 6f 63 2d 3e 44 6f |. fTECu|rDoc->Do|
|00001890| 49 64 6c 65 28 29 3b 0d | 7d 20 2f 2f 20 44 6f 49 |Idle();.|} // DoI|
|000018a0| 64 6c 65 0d 0d 2f 2f 20 | 43 68 61 6e 67 65 20 74 |dle..// |Change t|
|000018b0| 68 65 20 63 75 72 73 6f | 72 27 73 20 73 68 61 70 |he curso|r's shap|
|000018c0| 65 2c 20 64 65 70 65 6e | 64 69 6e 67 20 6f 6e 20 |e, depen|ding on |
|000018d0| 69 74 73 20 70 6f 73 69 | 74 69 6f 6e 2e 20 54 68 |its posi|tion. Th|
|000018e0| 69 73 20 61 6c 73 6f 20 | 63 61 6c 63 75 6c 61 74 |is also |calculat|
|000018f0| 65 73 20 61 0d 2f 2f 20 | 72 65 67 69 6f 6e 20 74 |es a.// |region t|
|00001900| 68 61 74 20 69 6e 63 6c | 75 64 65 73 20 74 68 65 |hat incl|udes the|
|00001910| 20 63 75 72 73 6f 72 20 | 66 6f 72 20 57 61 69 74 | cursor |for Wait|
|00001920| 4e 65 78 74 45 76 65 6e | 74 2e 0d 0d 76 6f 69 64 |NextEven|t...void|
|00001930| 20 54 45 53 61 6d 70 6c | 65 3a 3a 41 64 6a 75 73 | TESampl|e::Adjus|
|00001940| 74 43 75 72 73 6f 72 28 | 76 6f 69 64 29 0d 7b 0d |tCursor(|void).{.|
|00001950| 09 54 45 44 6f 63 75 6d | 65 6e 74 2a 20 66 54 45 |.TEDocum|ent* fTE|
|00001960| 43 75 72 44 6f 63 20 3d | 20 28 54 45 44 6f 63 75 |CurDoc =| (TEDocu|
|00001970| 6d 65 6e 74 2a 29 20 66 | 43 75 72 44 6f 63 3b 0d |ment*) f|CurDoc;.|
|00001980| 0d 09 2f 2f 20 6e 6f 74 | 69 63 65 20 74 68 61 74 |..// not|ice that|
|00001990| 20 77 65 20 64 6f 6e 27 | 74 20 63 68 61 6e 67 65 | we don'|t change|
|000019a0| 20 63 75 72 73 6f 72 20 | 69 66 20 66 72 6f 6e 74 | cursor |if front|
|000019b0| 20 77 69 6e 64 6f 77 20 | 69 73 6e 27 74 20 6f 75 | window |isn't ou|
|000019c0| 72 73 0d 09 69 66 20 28 | 20 28 21 66 49 6e 42 61 |rs..if (| (!fInBa|
|000019d0| 63 6b 67 72 6f 75 6e 64 | 29 20 26 26 20 28 66 54 |ckground|) && (fT|
|000019e0| 45 43 75 72 44 6f 63 20 | 21 3d 20 6e 69 6c 29 20 |ECurDoc |!= nil) |
|000019f0| 29 0d 09 20 20 7b 0d 09 | 09 52 67 6e 48 61 6e 64 |).. {..|.RgnHand|
|00001a00| 6c 65 09 61 72 72 6f 77 | 52 67 6e 3b 0d 09 09 52 |le.arrow|Rgn;...R|
|00001a10| 67 6e 48 61 6e 64 6c 65 | 09 69 42 65 61 6d 52 67 |gnHandle|.iBeamRg|
|00001a20| 6e 3b 0d 09 09 50 6f 69 | 6e 74 09 09 6d 6f 75 73 |n;...Poi|nt..mous|
|00001a30| 65 3b 0d 09 09 0d 09 09 | 2f 2f 20 67 65 74 20 6d |e;......|// get m|
|00001a40| 6f 75 73 65 20 6c 6f 63 | 61 74 69 6f 6e 20 61 6e |ouse loc|ation an|
|00001a50| 64 20 63 6f 6e 76 65 72 | 74 20 74 6f 20 67 6c 6f |d conver|t to glo|
|00001a60| 62 61 6c 20 63 6f 6f 72 | 64 69 6e 61 74 65 73 0d |bal coor|dinates.|
|00001a70| 09 09 47 65 74 4d 6f 75 | 73 65 28 26 6d 6f 75 73 |..GetMou|se(&mous|
|00001a80| 65 29 3b 0d 09 09 4c 6f | 63 61 6c 54 6f 47 6c 6f |e);...Lo|calToGlo|
|00001a90| 62 61 6c 28 26 6d 6f 75 | 73 65 29 3b 0d 0d 09 09 |bal(&mou|se);....|
|00001aa0| 2f 2f 20 63 61 6c 63 75 | 6c 61 74 65 20 72 65 67 |// calcu|late reg|
|00001ab0| 69 6f 6e 73 20 66 6f 72 | 20 64 69 66 66 65 72 65 |ions for| differe|
|00001ac0| 6e 74 20 63 75 72 73 6f | 72 20 73 68 61 70 65 73 |nt curso|r shapes|
|00001ad0| 0d 09 09 61 72 72 6f 77 | 52 67 6e 20 3d 20 4e 65 |...arrow|Rgn = Ne|
|00001ae0| 77 52 67 6e 28 29 3b 0d | 09 09 69 42 65 61 6d 52 |wRgn();.|..iBeamR|
|00001af0| 67 6e 20 3d 20 4e 65 77 | 52 67 6e 28 29 3b 0d 09 |gn = New|Rgn();..|
|00001b00| 09 2f 2f 20 73 74 61 72 | 74 20 61 72 72 6f 77 52 |.// star|t arrowR|
|00001b10| 67 6e 20 77 69 64 65 20 | 6f 70 65 6e 0d 09 09 53 |gn wide |open...S|
|00001b20| 65 74 52 65 63 74 52 67 | 6e 28 61 72 72 6f 77 52 |etRectRg|n(arrowR|
|00001b30| 67 6e 2c 20 6b 45 78 74 | 72 65 6d 65 4e 65 67 2c |gn, kExt|remeNeg,|
|00001b40| 20 6b 45 78 74 72 65 6d | 65 4e 65 67 2c 20 6b 45 | kExtrem|eNeg, kE|
|00001b50| 78 74 72 65 6d 65 50 6f | 73 2c 20 6b 45 78 74 72 |xtremePo|s, kExtr|
|00001b60| 65 6d 65 50 6f 73 29 3b | 0d 09 09 2f 2f 20 63 61 |emePos);|...// ca|
|00001b70| 6c 63 75 6c 61 74 65 20 | 69 42 65 61 6d 52 67 6e |lculate |iBeamRgn|
|00001b80| 0d 09 09 66 54 45 43 75 | 72 44 6f 63 2d 3e 47 65 |...fTECu|rDoc->Ge|
|00001b90| 74 56 69 73 54 45 52 67 | 6e 28 69 42 65 61 6d 52 |tVisTERg|n(iBeamR|
|00001ba0| 67 6e 29 3b 0d 09 09 2f | 2f 20 73 75 62 74 72 61 |gn);.../|/ subtra|
|00001bb0| 63 74 20 69 42 65 61 6d | 52 67 6e 20 66 72 6f 6d |ct iBeam|Rgn from|
|00001bc0| 20 61 72 72 6f 77 52 67 | 6e 20 0d 09 09 44 69 66 | arrowRg|n ...Dif|
|00001bd0| 66 52 67 6e 28 61 72 72 | 6f 77 52 67 6e 2c 20 69 |fRgn(arr|owRgn, i|
|00001be0| 42 65 61 6d 52 67 6e 2c | 20 61 72 72 6f 77 52 67 |BeamRgn,| arrowRg|
|00001bf0| 6e 29 3b 0d 0d 09 09 2f | 2f 20 63 68 61 6e 67 65 |n);..../|/ change|
|00001c00| 20 74 68 65 20 63 75 72 | 73 6f 72 20 61 6e 64 20 | the cur|sor and |
|00001c10| 74 68 65 20 72 65 67 69 | 6f 6e 20 70 61 72 61 6d |the regi|on param|
|00001c20| 65 74 65 72 20 0d 09 09 | 69 66 20 28 50 74 49 6e |eter ...|if (PtIn|
|00001c30| 52 67 6e 28 6d 6f 75 73 | 65 2c 20 69 42 65 61 6d |Rgn(mous|e, iBeam|
|00001c40| 52 67 6e 29 29 0d 09 09 | 20 20 7b 0d 09 09 09 53 |Rgn))...| {....S|
|00001c50| 65 74 43 75 72 73 6f 72 | 28 2a 47 65 74 43 75 72 |etCursor|(*GetCur|
|00001c60| 73 6f 72 28 69 42 65 61 | 6d 43 75 72 73 6f 72 29 |sor(iBea|mCursor)|
|00001c70| 29 3b 0d 09 09 09 43 6f | 70 79 52 67 6e 28 69 42 |);....Co|pyRgn(iB|
|00001c80| 65 61 6d 52 67 6e 2c 20 | 66 4d 6f 75 73 65 52 67 |eamRgn, |fMouseRg|
|00001c90| 6e 29 3b 0d 09 09 20 20 | 7d 0d 09 09 65 6c 73 65 |n);... |}...else|
|00001ca0| 0d 09 09 20 20 7b 0d 09 | 09 09 53 65 74 43 75 72 |... {..|..SetCur|
|00001cb0| 73 6f 72 28 26 71 64 2e | 61 72 72 6f 77 29 3b 0d |sor(&qd.|arrow);.|
|00001cc0| 09 09 09 43 6f 70 79 52 | 67 6e 28 61 72 72 6f 77 |...CopyR|gn(arrow|
|00001cd0| 52 67 6e 2c 20 66 4d 6f | 75 73 65 52 67 6e 29 3b |Rgn, fMo|useRgn);|
|00001ce0| 0d 09 09 20 20 7d 0d 09 | 09 2f 2f 20 67 65 74 20 |... }..|.// get |
|00001cf0| 72 69 64 20 6f 66 20 72 | 65 67 69 6f 6e 73 20 77 |rid of r|egions w|
|00001d00| 65 20 64 6f 6e 27 74 20 | 6e 65 65 64 20 61 6e 79 |e don't |need any|
|00001d10| 6d 6f 72 65 0d 09 09 44 | 69 73 70 6f 73 65 52 67 |more...D|isposeRg|
|00001d20| 6e 28 61 72 72 6f 77 52 | 67 6e 29 3b 0d 09 09 44 |n(arrowR|gn);...D|
|00001d30| 69 73 70 6f 73 65 52 67 | 6e 28 69 42 65 61 6d 52 |isposeRg|n(iBeamR|
|00001d40| 67 6e 29 3b 0d 09 20 20 | 7d 0d 7d 20 2f 2f 20 41 |gn);.. |}.} // A|
|00001d50| 64 6a 75 73 74 43 75 72 | 73 6f 72 0d 0d 2f 2f 20 |djustCur|sor..// |
|00001d60| 45 6e 61 62 6c 65 20 61 | 6e 64 20 64 69 73 61 62 |Enable a|nd disab|
|00001d70| 6c 65 20 6d 65 6e 75 73 | 20 62 61 73 65 64 20 6f |le menus| based o|
|00001d80| 6e 20 74 68 65 20 63 75 | 72 72 65 6e 74 20 73 74 |n the cu|rrent st|
|00001d90| 61 74 65 2e 20 54 68 65 | 0d 2f 2f 20 75 73 65 72 |ate. The|.// user|
|00001da0| 20 63 61 6e 20 6f 6e 6c | 79 20 73 65 6c 65 63 74 | can onl|y select|
|00001db0| 20 65 6e 61 62 6c 65 64 | 20 6d 65 6e 75 20 69 74 | enabled| menu it|
|00001dc0| 65 6d 73 2e 20 57 65 20 | 73 65 74 20 75 70 20 61 |ems. We |set up a|
|00001dd0| 6c 6c 20 74 68 65 0d 2f | 2f 20 6d 65 6e 75 20 69 |ll the./|/ menu i|
|00001de0| 74 65 6d 73 20 62 65 66 | 6f 72 65 20 63 61 6c 6c |tems bef|ore call|
|00001df0| 69 6e 67 20 4d 65 6e 75 | 53 65 6c 65 63 74 20 6f |ing Menu|Select o|
|00001e00| 72 20 4d 65 6e 75 4b 65 | 79 2c 20 73 69 6e 63 65 |r MenuKe|y, since|
|00001e10| 0d 2f 2f 20 74 68 65 73 | 65 20 61 72 65 20 74 68 |.// thes|e are th|
|00001e20| 65 20 6f 6e 6c 79 20 74 | 69 6d 65 73 20 74 68 61 |e only t|imes tha|
|00001e30| 74 20 61 20 6d 65 6e 75 | 20 69 74 65 6d 20 63 61 |t a menu| item ca|
|00001e40| 6e 20 62 65 20 73 65 6c | 65 63 74 65 64 2e 0d 2f |n be sel|ected../|
|00001e50| 2f 20 4e 6f 74 65 20 74 | 68 61 74 20 4d 65 6e 75 |/ Note t|hat Menu|
|00001e60| 53 65 6c 65 63 74 20 69 | 73 20 61 6c 73 6f 20 74 |Select i|s also t|
|00001e70| 68 65 20 6f 6e 6c 79 20 | 74 69 6d 65 20 74 68 65 |he only |time the|
|00001e80| 20 75 73 65 72 20 77 69 | 6c 6c 0d 2f 2f 20 73 65 | user wi|ll.// se|
|00001e90| 65 20 6d 65 6e 75 20 69 | 74 65 6d 73 2e 20 54 68 |e menu i|tems. Th|
|00001ea0| 69 73 20 61 70 70 72 6f | 61 63 68 20 74 6f 20 64 |is appro|ach to d|
|00001eb0| 65 63 69 64 69 6e 67 20 | 77 68 61 74 20 65 6e 61 |eciding |what ena|
|00001ec0| 62 6c 65 2f 0d 2f 2f 20 | 64 69 73 61 62 6c 65 20 |ble/.// |disable |
|00001ed0| 73 74 61 74 65 20 61 20 | 6d 65 6e 75 20 69 74 65 |state a |menu ite|
|00001ee0| 6d 20 68 61 73 20 74 68 | 65 20 61 64 76 61 6e 74 |m has th|e advant|
|00001ef0| 61 67 65 20 6f 66 0d 2f | 2f 20 63 6f 6e 63 65 6e |age of./|/ concen|
|00001f00| 74 72 61 74 69 6e 67 20 | 61 6c 6c 20 74 68 65 20 |trating |all the |
|00001f10| 64 65 63 69 73 69 6f 6e | 2d 6d 61 6b 69 6e 67 20 |decision|-making |
|00001f20| 69 6e 20 6f 6e 65 20 72 | 6f 75 74 69 6e 65 2c 20 |in one r|outine, |
|00001f30| 61 73 0d 2f 2f 20 6f 70 | 70 6f 73 65 64 20 74 6f |as.// op|posed to|
|00001f40| 20 62 65 69 6e 67 20 73 | 70 72 65 61 64 20 74 68 | being s|pread th|
|00001f50| 72 6f 75 67 68 6f 75 74 | 20 74 68 65 20 61 70 70 |roughout| the app|
|00001f60| 6c 69 63 61 74 69 6f 6e | 2e 20 4f 74 68 65 72 0d |lication|. Other.|
|00001f70| 2f 2f 20 61 70 70 6c 69 | 63 61 74 69 6f 6e 20 64 |// appli|cation d|
|00001f80| 65 73 69 67 6e 73 20 6d | 61 79 20 74 61 6b 65 20 |esigns m|ay take |
|00001f90| 61 20 64 69 66 66 65 72 | 65 6e 74 20 61 70 70 72 |a differ|ent appr|
|00001fa0| 6f 61 63 68 20 74 68 61 | 74 20 6d 61 79 0d 2f 2f |oach tha|t may.//|
|00001fb0| 20 6f 72 20 6d 61 79 20 | 6e 6f 74 20 62 65 20 61 | or may |not be a|
|00001fc0| 73 20 76 61 6c 69 64 2e | 20 0d 0d 76 6f 69 64 20 |s valid.| ..void |
|00001fd0| 54 45 53 61 6d 70 6c 65 | 3a 3a 41 64 6a 75 73 74 |TESample|::Adjust|
|00001fe0| 4d 65 6e 75 73 28 76 6f | 69 64 29 0d 7b 0d 09 57 |Menus(vo|id).{..W|
|00001ff0| 69 6e 64 6f 77 50 74 72 | 09 66 72 6f 6e 74 6d 6f |indowPtr|.frontmo|
|00002000| 73 74 3b 0d 09 4d 65 6e | 75 48 61 6e 64 6c 65 09 |st;..Men|uHandle.|
|00002010| 6d 65 6e 75 3b 0d 09 6c | 6f 6e 67 09 09 6f 66 66 |menu;..l|ong..off|
|00002020| 73 65 74 3b 0d 09 42 6f | 6f 6c 65 61 6e 09 09 75 |set;..Bo|olean..u|
|00002030| 6e 64 6f 3b 0d 09 42 6f | 6f 6c 65 61 6e 09 09 63 |ndo;..Bo|olean..c|
|00002040| 75 74 43 6f 70 79 43 6c | 65 61 72 3b 0d 09 42 6f |utCopyCl|ear;..Bo|
|00002050| 6f 6c 65 61 6e 09 09 70 | 61 73 74 65 3b 0d 09 54 |olean..p|aste;..T|
|00002060| 45 44 6f 63 75 6d 65 6e | 74 2a 20 66 54 45 43 75 |EDocumen|t* fTECu|
|00002070| 72 44 6f 63 20 3d 20 28 | 54 45 44 6f 63 75 6d 65 |rDoc = (|TEDocume|
|00002080| 6e 74 2a 29 20 66 43 75 | 72 44 6f 63 3b 0d 0d 09 |nt*) fCu|rDoc;...|
|00002090| 66 72 6f 6e 74 6d 6f 73 | 74 20 3d 20 46 72 6f 6e |frontmos|t = Fron|
|000020a0| 74 57 69 6e 64 6f 77 28 | 29 3b 0d 0d 09 6d 65 6e |tWindow(|);...men|
|000020b0| 75 20 3d 20 47 65 74 4d | 48 61 6e 64 6c 65 28 6d |u = GetM|Handle(m|
|000020c0| 46 69 6c 65 29 3b 0d 09 | 69 66 20 28 20 66 44 6f |File);..|if ( fDo|
|000020d0| 63 4c 69 73 74 2d 3e 4e | 75 6d 44 6f 63 73 28 29 |cList->N|umDocs()|
|000020e0| 20 3c 20 6b 4d 61 78 4f | 70 65 6e 44 6f 63 75 6d | < kMaxO|penDocum|
|000020f0| 65 6e 74 73 20 29 0d 09 | 20 20 45 6e 61 62 6c 65 |ents )..| Enable|
|00002100| 49 74 65 6d 28 6d 65 6e | 75 2c 20 69 4e 65 77 29 |Item(men|u, iNew)|
|00002110| 3b 09 09 09 2f 2f 20 4e | 65 77 20 69 73 20 65 6e |;...// N|ew is en|
|00002120| 61 62 6c 65 64 20 77 68 | 65 6e 20 77 65 20 63 61 |abled wh|en we ca|
|00002130| 6e 20 6f 70 65 6e 20 6d | 6f 72 65 20 64 6f 63 75 |n open m|ore docu|
|00002140| 6d 65 6e 74 73 20 0d 09 | 65 6c 73 65 20 44 69 73 |ments ..|else Dis|
|00002150| 61 62 6c 65 49 74 65 6d | 28 6d 65 6e 75 2c 20 69 |ableItem|(menu, i|
|00002160| 4e 65 77 29 3b 0d 09 69 | 66 20 28 20 66 72 6f 6e |New);..i|f ( fron|
|00002170| 74 6d 6f 73 74 20 21 3d | 20 28 57 69 6e 64 6f 77 |tmost !=| (Window|
|00002180| 50 74 72 29 20 6e 69 6c | 20 29 09 2f 2f 20 43 6c |Ptr) nil| ).// Cl|
|00002190| 6f 73 65 20 69 73 20 65 | 6e 61 62 6c 65 64 20 77 |ose is e|nabled w|
|000021a0| 68 65 6e 20 74 68 65 72 | 65 20 69 73 20 61 20 77 |hen ther|e is a w|
|000021b0| 69 6e 64 6f 77 20 74 6f | 20 63 6c 6f 73 65 20 0d |indow to| close .|
|000021c0| 09 20 20 45 6e 61 62 6c | 65 49 74 65 6d 28 6d 65 |. Enabl|eItem(me|
|000021d0| 6e 75 2c 20 69 43 6c 6f | 73 65 29 3b 0d 09 65 6c |nu, iClo|se);..el|
|000021e0| 73 65 20 44 69 73 61 62 | 6c 65 49 74 65 6d 28 6d |se Disab|leItem(m|
|000021f0| 65 6e 75 2c 20 69 43 6c | 6f 73 65 29 3b 0d 0d 09 |enu, iCl|ose);...|
|00002200| 6d 65 6e 75 20 3d 20 47 | 65 74 4d 48 61 6e 64 6c |menu = G|etMHandl|
|00002210| 65 28 6d 45 64 69 74 29 | 3b 0d 09 75 6e 64 6f 20 |e(mEdit)|;..undo |
|00002220| 3d 20 66 61 6c 73 65 3b | 0d 09 63 75 74 43 6f 70 |= false;|..cutCop|
|00002230| 79 43 6c 65 61 72 20 3d | 20 66 61 6c 73 65 3b 0d |yClear =| false;.|
|00002240| 09 70 61 73 74 65 20 3d | 20 66 61 6c 73 65 3b 0d |.paste =| false;.|
|00002250| 09 69 66 20 28 66 72 6f | 6e 74 6d 6f 73 74 20 21 |.if (fro|ntmost !|
|00002260| 3d 20 6e 69 6c 29 0d 09 | 20 20 7b 0d 09 09 69 66 |= nil)..| {...if|
|00002270| 20 28 66 54 45 43 75 72 | 44 6f 63 20 3d 3d 20 6e | (fTECur|Doc == n|
|00002280| 69 6c 29 0d 09 09 20 20 | 7b 0d 09 09 09 75 6e 64 |il)... |{....und|
|00002290| 6f 20 3d 20 74 72 75 65 | 3b 09 09 09 09 2f 2f 20 |o = true|;....// |
|000022a0| 61 6c 6c 20 65 64 69 74 | 69 6e 67 20 69 73 20 65 |all edit|ing is e|
|000022b0| 6e 61 62 6c 65 64 20 66 | 6f 72 20 44 41 20 77 69 |nabled f|or DA wi|
|000022c0| 6e 64 6f 77 73 20 0d 09 | 09 09 63 75 74 43 6f 70 |ndows ..|..cutCop|
|000022d0| 79 43 6c 65 61 72 20 3d | 20 74 72 75 65 3b 0d 09 |yClear =| true;..|
|000022e0| 09 09 70 61 73 74 65 20 | 3d 20 74 72 75 65 3b 0d |..paste |= true;.|
|000022f0| 09 09 20 20 7d 0d 09 09 | 65 6c 73 65 0d 09 09 20 |.. }...|else... |
|00002300| 20 7b 0d 09 09 09 2f 2f | 20 43 75 74 2c 20 43 6f | {....//| Cut, Co|
|00002310| 70 79 2c 20 61 6e 64 20 | 43 6c 65 61 72 20 69 73 |py, and |Clear is|
|00002320| 20 65 6e 61 62 6c 65 64 | 20 66 6f 72 20 61 70 70 | enabled| for app|
|00002330| 2e 20 77 69 6e 64 6f 77 | 73 20 77 69 74 68 20 73 |. window|s with s|
|00002340| 65 6c 65 63 74 69 6f 6e | 73 20 0d 09 09 09 69 66 |election|s ....if|
|00002350| 20 28 20 66 54 45 43 75 | 72 44 6f 63 2d 3e 48 61 | ( fTECu|rDoc->Ha|
|00002360| 76 65 53 65 6c 65 63 74 | 69 6f 6e 28 29 20 29 0d |veSelect|ion() ).|
|00002370| 09 09 09 20 20 63 75 74 | 43 6f 70 79 43 6c 65 61 |... cut|CopyClea|
|00002380| 72 20 3d 20 74 72 75 65 | 3b 0d 09 09 09 2f 2f 20 |r = true|;....// |
|00002390| 49 66 20 77 65 20 68 61 | 76 65 20 61 6e 79 20 54 |If we ha|ve any T|
|000023a0| 45 58 54 20 69 6e 20 74 | 68 65 20 73 63 72 61 70 |EXT in t|he scrap|
|000023b0| 2c 20 65 6e 61 62 6c 65 | 20 70 61 73 74 65 0d 09 |, enable| paste..|
|000023c0| 09 09 69 66 20 28 20 47 | 65 74 53 63 72 61 70 28 |..if ( G|etScrap(|
|000023d0| 6e 69 6c 2c 20 27 54 45 | 58 54 27 2c 20 26 6f 66 |nil, 'TE|XT', &of|
|000023e0| 66 73 65 74 29 20 29 0d | 09 09 09 09 70 61 73 74 |fset) ).|....past|
|000023f0| 65 20 3d 20 74 72 75 65 | 3b 20 0d 09 09 20 20 7d |e = true|; ... }|
|00002400| 0d 09 20 20 7d 0d 09 69 | 66 20 28 20 75 6e 64 6f |.. }..i|f ( undo|
|00002410| 20 29 0d 09 20 20 45 6e | 61 62 6c 65 49 74 65 6d | ).. En|ableItem|
|00002420| 28 6d 65 6e 75 2c 20 69 | 55 6e 64 6f 29 3b 0d 09 |(menu, i|Undo);..|
|00002430| 65 6c 73 65 20 44 69 73 | 61 62 6c 65 49 74 65 6d |else Dis|ableItem|
|00002440| 28 6d 65 6e 75 2c 20 69 | 55 6e 64 6f 29 3b 0d 09 |(menu, i|Undo);..|
|00002450| 69 66 20 28 20 63 75 74 | 43 6f 70 79 43 6c 65 61 |if ( cut|CopyClea|
|00002460| 72 20 29 0d 09 20 20 7b | 0d 09 09 45 6e 61 62 6c |r ).. {|...Enabl|
|00002470| 65 49 74 65 6d 28 6d 65 | 6e 75 2c 20 69 43 75 74 |eItem(me|nu, iCut|
|00002480| 29 3b 0d 09 09 45 6e 61 | 62 6c 65 49 74 65 6d 28 |);...Ena|bleItem(|
|00002490| 6d 65 6e 75 2c 20 69 43 | 6f 70 79 29 3b 0d 09 09 |menu, iC|opy);...|
|000024a0| 45 6e 61 62 6c 65 49 74 | 65 6d 28 6d 65 6e 75 2c |EnableIt|em(menu,|
|000024b0| 20 69 43 6c 65 61 72 29 | 3b 0d 09 20 20 7d 20 0d | iClear)|;.. } .|
|000024c0| 09 65 6c 73 65 0d 09 20 | 20 7b 0d 09 09 44 69 73 |.else.. | {...Dis|
|000024d0| 61 62 6c 65 49 74 65 6d | 28 6d 65 6e 75 2c 20 69 |ableItem|(menu, i|
|000024e0| 43 75 74 29 3b 0d 09 09 | 44 69 73 61 62 6c 65 49 |Cut);...|DisableI|
|000024f0| 74 65 6d 28 6d 65 6e 75 | 2c 20 69 43 6f 70 79 29 |tem(menu|, iCopy)|
|00002500| 3b 0d 09 09 44 69 73 61 | 62 6c 65 49 74 65 6d 28 |;...Disa|bleItem(|
|00002510| 6d 65 6e 75 2c 20 69 43 | 6c 65 61 72 29 3b 0d 09 |menu, iC|lear);..|
|00002520| 20 20 7d 0d 09 69 66 20 | 28 20 70 61 73 74 65 20 | }..if |( paste |
|00002530| 29 0d 09 09 45 6e 61 62 | 6c 65 49 74 65 6d 28 6d |)...Enab|leItem(m|
|00002540| 65 6e 75 2c 20 69 50 61 | 73 74 65 29 3b 0d 09 65 |enu, iPa|ste);..e|
|00002550| 6c 73 65 20 44 69 73 61 | 62 6c 65 49 74 65 6d 28 |lse Disa|bleItem(|
|00002560| 6d 65 6e 75 2c 20 69 50 | 61 73 74 65 29 3b 0d 7d |menu, iP|aste);.}|
|00002570| 20 2f 2f 20 41 64 6a 75 | 73 74 4d 65 6e 75 73 0d | // Adju|stMenus.|
|00002580| 0d 0d 2f 2f 20 54 68 69 | 73 20 69 73 20 63 61 6c |..// Thi|s is cal|
|00002590| 6c 65 64 20 77 68 65 6e | 20 61 6e 20 69 74 65 6d |led when| an item|
|000025a0| 20 69 73 20 63 68 6f 73 | 65 6e 20 66 72 6f 6d 20 | is chos|en from |
|000025b0| 74 68 65 20 6d 65 6e 75 | 20 62 61 72 20 28 61 66 |the menu| bar (af|
|000025c0| 74 65 72 20 63 61 6c 6c | 69 6e 67 0d 2f 2f 20 4d |ter call|ing.// M|
|000025d0| 65 6e 75 53 65 6c 65 63 | 74 20 6f 72 20 4d 65 6e |enuSelec|t or Men|
|000025e0| 75 4b 65 79 29 2e 20 49 | 74 20 64 6f 65 73 20 74 |uKey). I|t does t|
|000025f0| 68 65 20 72 69 67 68 74 | 20 74 68 69 6e 67 20 66 |he right| thing f|
|00002600| 6f 72 20 65 61 63 68 20 | 63 6f 6d 6d 61 6e 64 2e |or each |command.|
|00002610| 0d 0d 76 6f 69 64 20 54 | 45 53 61 6d 70 6c 65 3a |..void T|ESample:|
|00002620| 3a 44 6f 4d 65 6e 75 43 | 6f 6d 6d 61 6e 64 28 73 |:DoMenuC|ommand(s|
|00002630| 68 6f 72 74 20 6d 65 6e | 75 49 44 2c 20 73 68 6f |hort men|uID, sho|
|00002640| 72 74 20 6d 65 6e 75 49 | 74 65 6d 29 0d 7b 0d 09 |rt menuI|tem).{..|
|00002650| 73 68 6f 72 74 09 09 69 | 74 65 6d 48 69 74 3b 0d |short..i|temHit;.|
|00002660| 09 53 74 72 32 35 35 09 | 09 64 61 4e 61 6d 65 3b |.Str255.|.daName;|
|00002670| 0d 09 73 68 6f 72 74 09 | 09 64 61 52 65 66 4e 75 |..short.|.daRefNu|
|00002680| 6d 3b 0d 09 57 69 6e 64 | 6f 77 50 74 72 09 77 69 |m;..Wind|owPtr.wi|
|00002690| 6e 64 6f 77 3b 0d 09 54 | 45 44 6f 63 75 6d 65 6e |ndow;..T|EDocumen|
|000026a0| 74 2a 20 66 54 45 43 75 | 72 44 6f 63 20 3d 20 28 |t* fTECu|rDoc = (|
|000026b0| 54 45 44 6f 63 75 6d 65 | 6e 74 2a 29 20 66 43 75 |TEDocume|nt*) fCu|
|000026c0| 72 44 6f 63 3b 0d 0d 09 | 77 69 6e 64 6f 77 20 3d |rDoc;...|window =|
|000026d0| 20 46 72 6f 6e 74 57 69 | 6e 64 6f 77 28 29 3b 0d | FrontWi|ndow();.|
|000026e0| 09 73 77 69 74 63 68 20 | 28 20 6d 65 6e 75 49 44 |.switch |( menuID|
|000026f0| 20 29 0d 09 20 20 7b 0d | 09 09 63 61 73 65 20 6d | ).. {.|..case m|
|00002700| 41 70 70 6c 65 3a 0d 09 | 09 09 73 77 69 74 63 68 |Apple:..|..switch|
|00002710| 20 28 20 6d 65 6e 75 49 | 74 65 6d 20 29 0d 09 09 | ( menuI|tem )...|
|00002720| 09 20 20 7b 0d 09 09 09 | 09 63 61 73 65 20 69 41 |. {....|.case iA|
|00002730| 62 6f 75 74 3a 09 09 2f | 2f 20 62 72 69 6e 67 20 |bout:../|/ bring |
|00002740| 75 70 20 61 6c 65 72 74 | 20 66 6f 72 20 41 62 6f |up alert| for Abo|
|00002750| 75 74 20 0d 09 09 09 09 | 09 69 74 65 6d 48 69 74 |ut .....|.itemHit|
|00002760| 20 3d 20 41 6c 65 72 74 | 28 72 41 62 6f 75 74 41 | = Alert|(rAboutA|
|00002770| 6c 65 72 74 2c 20 6e 69 | 6c 29 3b 0d 09 09 09 09 |lert, ni|l);.....|
|00002780| 09 62 72 65 61 6b 3b 0d | 09 09 09 09 64 65 66 61 |.break;.|....defa|
|00002790| 75 6c 74 3a 09 09 09 2f | 2f 20 61 6c 6c 20 6e 6f |ult:.../|/ all no|
|000027a0| 6e 2d 41 62 6f 75 74 20 | 69 74 65 6d 73 20 69 6e |n-About |items in|
|000027b0| 20 74 68 69 73 20 6d 65 | 6e 75 20 61 72 65 20 44 | this me|nu are D|
|000027c0| 41 73 20 65 74 20 61 6c | 20 0d 09 09 09 09 09 47 |As et al| ......G|
|000027d0| 65 74 49 74 65 6d 28 47 | 65 74 4d 48 61 6e 64 6c |etItem(G|etMHandl|
|000027e0| 65 28 6d 41 70 70 6c 65 | 29 2c 20 6d 65 6e 75 49 |e(mApple|), menuI|
|000027f0| 74 65 6d 2c 20 64 61 4e | 61 6d 65 29 3b 0d 09 09 |tem, daN|ame);...|
|00002800| 09 09 09 64 61 52 65 66 | 4e 75 6d 20 3d 20 4f 70 |...daRef|Num = Op|
|00002810| 65 6e 44 65 73 6b 41 63 | 63 28 64 61 4e 61 6d 65 |enDeskAc|c(daName|
|00002820| 29 3b 0d 09 09 09 09 09 | 62 72 65 61 6b 3b 0d 09 |);......|break;..|
|00002830| 09 09 20 20 7d 0d 09 09 | 09 62 72 65 61 6b 3b 0d |.. }...|.break;.|
|00002840| 09 09 63 61 73 65 20 6d | 46 69 6c 65 3a 0d 09 09 |..case m|File:...|
|00002850| 09 73 77 69 74 63 68 20 | 28 20 6d 65 6e 75 49 74 |.switch |( menuIt|
|00002860| 65 6d 20 29 0d 09 09 09 | 20 20 7b 0d 09 09 09 09 |em )....| {.....|
|00002870| 63 61 73 65 20 69 4e 65 | 77 3a 0d 09 09 09 09 09 |case iNe|w:......|
|00002880| 44 6f 4e 65 77 28 29 3b | 0d 09 09 09 09 09 62 72 |DoNew();|......br|
|00002890| 65 61 6b 3b 0d 09 09 09 | 09 63 61 73 65 20 69 43 |eak;....|.case iC|
|000028a0| 6c 6f 73 65 3a 0d 09 09 | 09 09 09 69 66 20 28 66 |lose:...|...if (f|
|000028b0| 54 45 43 75 72 44 6f 63 | 20 21 3d 20 6e 69 6c 29 |TECurDoc| != nil)|
|000028c0| 0d 09 09 09 09 09 20 20 | 7b 0d 09 09 09 09 09 09 |...... |{.......|
|000028d0| 66 44 6f 63 4c 69 73 74 | 2d 3e 52 65 6d 6f 76 65 |fDocList|->Remove|
|000028e0| 44 6f 63 28 66 54 45 43 | 75 72 44 6f 63 29 3b 0d |Doc(fTEC|urDoc);.|
|000028f0| 09 09 09 09 09 09 64 65 | 6c 65 74 65 20 66 54 45 |......de|lete fTE|
|00002900| 43 75 72 44 6f 63 3b 0d | 09 09 09 09 09 20 20 7d |CurDoc;.|..... }|
|00002910| 0d 09 09 09 09 09 65 6c | 73 65 20 43 6c 6f 73 65 |......el|se Close|
|00002920| 44 65 73 6b 41 63 63 28 | 28 28 57 69 6e 64 6f 77 |DeskAcc(|((Window|
|00002930| 50 65 65 6b 29 20 66 57 | 68 69 63 68 57 69 6e 64 |Peek) fW|hichWind|
|00002940| 6f 77 29 2d 3e 77 69 6e | 64 6f 77 4b 69 6e 64 29 |ow)->win|dowKind)|
|00002950| 3b 0d 09 09 09 09 09 62 | 72 65 61 6b 3b 0d 09 09 |;......b|reak;...|
|00002960| 09 09 63 61 73 65 20 69 | 51 75 69 74 3a 0d 09 09 |..case i|Quit:...|
|00002970| 09 09 09 54 65 72 6d 69 | 6e 61 74 65 28 29 3b 0d |...Termi|nate();.|
|00002980| 09 09 09 09 09 62 72 65 | 61 6b 3b 0d 09 09 09 20 |.....bre|ak;.... |
|00002990| 20 7d 0d 09 09 09 62 72 | 65 61 6b 3b 0d 09 09 63 | }....br|eak;...c|
|000029a0| 61 73 65 20 6d 45 64 69 | 74 3a 09 09 09 09 09 2f |ase mEdi|t:...../|
|000029b0| 2f 20 63 61 6c 6c 20 53 | 79 73 74 65 6d 45 64 69 |/ call S|ystemEdi|
|000029c0| 74 20 66 6f 72 20 44 41 | 20 65 64 69 74 69 6e 67 |t for DA| editing|
|000029d0| 20 26 20 4d 75 6c 74 69 | 46 69 6e 64 65 72 20 0d | & Multi|Finder .|
|000029e0| 09 09 09 69 66 20 28 20 | 21 53 79 73 74 65 6d 45 |...if ( |!SystemE|
|000029f0| 64 69 74 28 6d 65 6e 75 | 49 74 65 6d 2d 31 29 20 |dit(menu|Item-1) |
|00002a00| 29 0d 09 09 09 20 20 7b | 0d 09 09 09 09 73 77 69 |).... {|.....swi|
|00002a10| 74 63 68 20 28 20 6d 65 | 6e 75 49 74 65 6d 20 29 |tch ( me|nuItem )|
|00002a20| 0d 09 09 09 09 20 20 7b | 0d 09 09 09 09 09 63 61 |..... {|......ca|
|00002a30| 73 65 20 69 43 75 74 3a | 0d 09 09 09 09 09 09 66 |se iCut:|.......f|
|00002a40| 54 45 43 75 72 44 6f 63 | 2d 3e 44 6f 43 75 74 28 |TECurDoc|->DoCut(|
|00002a50| 29 3b 0d 09 09 09 09 09 | 09 62 72 65 61 6b 3b 0d |);......|.break;.|
|00002a60| 09 09 09 09 09 63 61 73 | 65 20 69 43 6f 70 79 3a |.....cas|e iCopy:|
|00002a70| 0d 09 09 09 09 09 09 66 | 54 45 43 75 72 44 6f 63 |.......f|TECurDoc|
|00002a80| 2d 3e 44 6f 43 6f 70 79 | 28 29 3b 0d 09 09 09 09 |->DoCopy|();.....|
|00002a90| 09 09 62 72 65 61 6b 3b | 0d 09 09 09 09 09 63 61 |..break;|......ca|
|00002aa0| 73 65 20 69 50 61 73 74 | 65 3a 0d 09 09 09 09 09 |se iPast|e:......|
|00002ab0| 09 66 54 45 43 75 72 44 | 6f 63 2d 3e 44 6f 50 61 |.fTECurD|oc->DoPa|
|00002ac0| 73 74 65 28 29 3b 0d 09 | 09 09 09 09 09 62 72 65 |ste();..|.....bre|
|00002ad0| 61 6b 3b 0d 09 09 09 09 | 09 63 61 73 65 20 69 43 |ak;.....|.case iC|
|00002ae0| 6c 65 61 72 3a 0d 09 09 | 09 09 09 09 66 54 45 43 |lear:...|....fTEC|
|00002af0| 75 72 44 6f 63 2d 3e 44 | 6f 43 6c 65 61 72 28 29 |urDoc->D|oClear()|
|00002b00| 3b 0d 09 09 09 09 09 09 | 62 72 65 61 6b 3b 0d 09 |;.......|break;..|
|00002b10| 09 09 09 20 20 20 7d 0d | 09 09 09 20 20 7d 0d 09 |... }.|... }..|
|00002b20| 09 09 62 72 65 61 6b 3b | 0d 09 20 20 7d 0d 09 48 |..break;|.. }..H|
|00002b30| 69 6c 69 74 65 4d 65 6e | 75 28 30 29 3b 09 09 09 |iliteMen|u(0);...|
|00002b40| 09 09 2f 2f 20 75 6e 68 | 69 67 68 6c 69 67 68 74 |..// unh|ighlight|
|00002b50| 20 77 68 61 74 20 4d 65 | 6e 75 53 65 6c 65 63 74 | what Me|nuSelect|
|00002b60| 20 28 6f 72 20 4d 65 6e | 75 4b 65 79 29 20 68 69 | (or Men|uKey) hi|
|00002b70| 6c 69 74 65 64 20 0d 7d | 20 2f 2f 20 44 6f 4d 65 |lited .}| // DoMe|
|00002b80| 6e 75 43 6f 6d 6d 61 6e | 64 0d 0d 2f 2f 20 43 72 |nuComman|d..// Cr|
|00002b90| 65 61 74 65 20 61 20 6e | 65 77 20 64 6f 63 75 6d |eate a n|ew docum|
|00002ba0| 65 6e 74 20 61 6e 64 20 | 77 69 6e 64 6f 77 2e 20 |ent and |window. |
|00002bb0| 0d 0d 76 6f 69 64 20 54 | 45 53 61 6d 70 6c 65 3a |..void T|ESample:|
|00002bc0| 3a 44 6f 4e 65 77 28 76 | 6f 69 64 29 0d 7b 0d 09 |:DoNew(v|oid).{..|
|00002bd0| 54 45 44 6f 63 75 6d 65 | 6e 74 2a 20 74 44 6f 63 |TEDocume|nt* tDoc|
|00002be0| 3b 0d 0d 09 74 44 6f 63 | 20 3d 20 6e 65 77 20 54 |;...tDoc| = new T|
|00002bf0| 45 44 6f 63 75 6d 65 6e | 74 28 72 44 6f 63 57 69 |EDocumen|t(rDocWi|
|00002c00| 6e 64 6f 77 29 3b 0d 09 | 2f 2f 20 69 66 20 77 65 |ndow);..|// if we|
|00002c10| 20 64 69 64 6e 27 74 20 | 67 65 74 20 61 6e 20 61 | didn't |get an a|
|00002c20| 6c 6c 6f 63 61 74 69 6f | 6e 20 65 72 72 6f 72 2c |llocatio|n error,|
|00002c30| 20 61 64 64 20 69 74 20 | 74 6f 20 6c 69 73 74 0d | add it |to list.|
|00002c40| 09 69 66 20 28 74 44 6f | 63 20 21 3d 20 6e 69 6c |.if (tDo|c != nil|
|00002c50| 29 0d 09 20 20 66 44 6f | 63 4c 69 73 74 2d 3e 41 |).. fDo|cList->A|
|00002c60| 64 64 44 6f 63 28 74 44 | 6f 63 29 3b 0d 7d 20 2f |ddDoc(tD|oc);.} /|
|00002c70| 2f 20 44 6f 4e 65 77 0d | 0d 2f 2f 20 43 6c 65 61 |/ DoNew.|.// Clea|
|00002c80| 6e 20 75 70 20 74 68 65 | 20 61 70 70 6c 69 63 61 |n up the| applica|
|00002c90| 74 69 6f 6e 20 61 6e 64 | 20 65 78 69 74 73 2e 20 |tion and| exits. |
|00002ca0| 57 65 20 63 6c 6f 73 65 | 20 61 6c 6c 20 6f 66 20 |We close| all of |
|00002cb0| 74 68 65 20 77 69 6e 64 | 6f 77 73 20 73 6f 20 74 |the wind|ows so t|
|00002cc0| 68 61 74 0d 2f 2f 20 74 | 68 65 79 20 63 61 6e 20 |hat.// t|hey can |
|00002cd0| 75 70 64 61 74 65 20 74 | 68 65 69 72 20 64 6f 63 |update t|heir doc|
|00002ce0| 75 6d 65 6e 74 73 2e 0d | 0d 76 6f 69 64 20 54 45 |uments..|.void TE|
|00002cf0| 53 61 6d 70 6c 65 3a 3a | 54 65 72 6d 69 6e 61 74 |Sample::|Terminat|
|00002d00| 65 28 76 6f 69 64 29 0d | 7b 0d 09 2f 2f 20 46 49 |e(void).|{..// FI|
|00002d10| 58 3a 20 63 6c 6f 73 65 | 20 61 6c 6c 20 64 6f 63 |X: close| all doc|
|00002d20| 73 0d 09 45 78 69 74 4c | 6f 6f 70 28 29 3b 0d 7d |s..ExitL|oop();.}|
|00002d30| 20 2f 2f 20 54 65 72 6d | 69 6e 61 74 65 0d 0d 00 | // Term|inate...|
|00002d40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002d50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002d60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002d70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002d80| 00 00 01 00 00 00 01 4c | 00 00 00 4c 00 00 00 32 |.......L|...L...2|
|00002d90| 43 6f 70 79 43 6c 65 61 | 72 20 3d 20 54 52 55 45 |CopyClea|r = TRUE|
|00002da0| 3b 0d 09 09 70 61 73 74 | 65 20 3d 20 54 52 55 45 |;...past|e = TRUE|
|00002db0| 0b 54 45 53 61 6d 70 6c | 65 2e 63 70 02 00 00 00 |.TESampl|e.cp....|
|00002dc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002dd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002de0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002df0| 00 00 a0 a1 88 e3 00 00 | 00 00 00 00 01 7e 29 5b |........|.....~)[|
|00002e00| 30 5d 5b 30 5d 20 29 0d | 09 09 09 69 66 20 28 20 |0][0] ).|...if ( |
|00002e10| 73 65 6c 53 74 61 72 74 | 20 3c 20 73 65 6c 45 6e |selStart| < selEn|
|00002e20| 64 20 29 0d 09 09 09 09 | 63 75 74 43 6f 70 79 43 |d ).....|cutCopyC|
|00002e30| 6c 65 61 72 20 3d 20 54 | 52 55 45 3b 0d 09 09 09 |lear = T|RUE;....|
|00002e40| 09 2f 2a 43 75 74 2c 20 | 43 6f 70 79 2c 20 61 6e |./*Cut, |Copy, an|
|00002e50| 64 20 43 6c 65 61 72 20 | 69 73 20 65 6e 61 62 6c |d Clear |is enabl|
|00002e60| 65 64 20 66 6f 72 20 61 | 70 70 2e 20 77 69 6e 64 |ed for a|pp. wind|
|00002e70| 6f 77 73 20 77 69 74 68 | 20 73 65 6c 65 63 74 69 |ows with| selecti|
|00002e80| 00 00 00 48 00 09 4d 6f | 6e 61 63 6f 00 00 01 d1 |...H..Mo|naco....|
|00002e90| 00 00 00 14 00 01 21 a8 | 00 0a 00 00 00 00 00 00 |......!.|........|
|00002ea0| 00 00 01 d8 00 00 00 06 | 00 04 00 27 00 00 01 df |........|...'....|
|00002eb0| 02 30 00 3e 00 0f 01 c9 | 02 69 a0 72 17 1e 00 00 |.0.>....|.i.r....|
|00002ec0| 00 00 00 00 00 00 00 00 | 00 00 01 00 00 00 01 00 |........|........|
|00002ed0| 00 00 01 4c 00 00 00 4c | 00 00 00 32 00 16 a5 64 |...L...L|...2...d|
|00002ee0| 07 5a 00 00 00 1c 00 32 | 00 00 4d 50 53 52 00 00 |.Z.....2|..MPSR..|
|00002ef0| 00 0a 03 ed ff ff 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+